package com.student.system.controller;

import com.student.system.service.AdminService;
import com.student.system.service.impl.AdminServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

@WebServlet("/admin/*")
public class AdminServlet extends BaseServlet{
    public AdminService adminService = new AdminServiceImpl();

    public void doLogin(HttpServletRequest req, HttpServletResponse resp){
        adminService.doLogin(req,resp);
    }

    public void studentMessage(HttpServletRequest req, HttpServletResponse resp){
        adminService.message(req,resp);
    }

    public void StudentRegisterMain(HttpServletRequest req, HttpServletResponse resp){
        adminService.StudentRegister(req,resp);
    }
    public void TeacherMessageMain(HttpServletRequest req, HttpServletResponse resp){
        adminService.teacherMessage(req,resp);
    }
    public void TeacherRegisterMain(HttpServletRequest req, HttpServletResponse resp){
        adminService.teacherRegister(req,resp);
    }
    public void StudentMessageEdit(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        adminService.StudentMessageEdit(req,resp);
    }
    public void doEditStudentMessage(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        adminService.doEditStudentMessage(req,resp);
    }
    public void StudentRegisterEdit(HttpServletRequest req, HttpServletResponse resp) throws ServletException, SQLException, IOException {
        adminService.StudentRegisterEdit(req,resp);

    }
    public void doEditStudentRegister(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {
        adminService.doEditStudentRegister(req,resp);
    }
    public void TeacherRegisterEdit(HttpServletRequest req, HttpServletResponse resp) throws ServletException, SQLException, IOException {
        adminService.TeacherRegisterEdit(req,resp);

    }
    public void doEditTeacherRegister(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {
        adminService.doEditTeacherRegister(req,resp);
    }

    public void TeacherMessageEdit(HttpServletRequest req, HttpServletResponse resp) throws Exception {
        adminService.TeacherMessageEdit(req,resp);
    }
    public void doEditTeacherMessage(HttpServletRequest req, HttpServletResponse resp) throws SQLException, IOException {
        adminService.doEditTeacherMessage(req,resp);
    }
}
